Rename the source domain on migration, regardless of the live flag. This fixes
authoremellor@ewan <emellor@ewan>
Fri, 7 Oct 2005 09:58:41 +0000 (10:58 +0100)
committeremellor@ewan <emellor@ewan>
Fri, 7 Oct 2005 09:58:41 +0000 (10:58 +0100)
localhost non-live migration, and bug #297.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendCheckpoint.py

index 9250f71b6ca5f2fd228c51fc8bbd8130c4fa213a..3d45bdb60abbcf1a4e0db6ac895891b64f6fc6ed 100644 (file)
@@ -48,9 +48,10 @@ def save(fd, dominfo, live):
     config = sxp.to_string(dominfo.sxpr())
 
     domain_name = dominfo.getName()
-
-    if live:
-        dominfo.setName('migrating-' + domain_name)
+    # Rename the domain temporarily, so that we don't get a name clash if this
+    # domain is migrating (live or non-live) to the local host.  Doing such a
+    # thing is useful for debugging.
+    dominfo.setName('migrating-' + domain_name)
 
     try:
         write_exact(fd, pack("!i", len(config)),
@@ -85,8 +86,7 @@ def save(fd, dominfo, live):
         log.exception("Save failed on domain %s (%d).", domain_name,
                       dominfo.getDomid())
         try:
-            if live:
-                dominfo.setName(domain_name)
+            dominfo.setName(domain_name)
         except:
             log.exception("Failed to reset the migrating domain's name")
         raise Exception, exn